package org.sdfc.model.dfc

import com.documentum.fc.client.IDfTypedObject
import com.documentum.fc.common.IDfId
import com.documentum.fc.common.IDfTime

import org.sdfc.model.attr._

/** DfcMutableTypedObject implementation for mixing with IDfTypedObject implementation.
 */
trait DfcMutableTypedObjectMixin extends DfcMutableTypedObject {
  
  self : IDfTypedObject =>
  
  
  /** Reads the value of a SingleBooleanAttribute. */
  def getBoolean(attr : SingleBooleanAttribute) : Boolean = self.getBoolean(attr.name)
  
  /** Reads the value of a SingleIntAttribute. */
  def getInt(attr : SingleIntAttribute) : Int = self.getInt(attr.name)
  
  /** Reads the value of a SingleStringAttribute. */
  def getString(attr : SingleStringAttribute) : String = self.getString(attr.name)
  
  /** Reads the value of a SingleIdAttribute. */
  def getId(attr : SingleIdAttribute) : IDfId = self.getId(attr.name)
  
  /** Reads the value of a SingleTimeAttribute. */
  def getTime(attr : SingleTimeAttribute) : IDfTime = self.getTime(attr.name)
  
  /** Reads the value of a SingleDoubleAttribute. */
  def getDouble(attr : SingleDoubleAttribute) : Double = self.getDouble(attr.name)
  
  
  /** Counts the values of a RepeatingAttribute. */
  def getValueCount(attr : RepeatingAttribute[_]) : Int = self.getValueCount(attr.name)
  
  /** Reads the value of a RepeatingBooleanAttribute at a given index. */
  def getRepeatingBoolean(attr : RepeatingBooleanAttribute, index : Int) : Boolean = self.getRepeatingBoolean(attr.name, index)
  
  /** Reads the value of a RepeatingIntAttribute at a given index. */
  def getRepeatingInt(attr : RepeatingIntAttribute, index : Int) : Int = self.getRepeatingInt(attr.name, index)
  
  /** Reads the value of a RepeatingStringAttribute at a given index. */
  def getRepeatingString(attr : RepeatingStringAttribute, index : Int) : String = self.getRepeatingString(attr.name, index)
  
  /** Reads the value of a RepeatingIdAttribute at a given index. */
  def getRepeatingId(attr : RepeatingIdAttribute, index : Int) : IDfId = self.getRepeatingId(attr.name, index)
  
  /** Reads the value of a RepeatingTimeAttribute at a given index. */
  def getRepeatingTime(attr : RepeatingTimeAttribute, index : Int) : IDfTime = self.getRepeatingTime(attr.name, index)
  
  /** Reads the value of a RepeatingDoubleAttribute at a given index. */
  def getRepeatingDouble(attr : RepeatingDoubleAttribute, index : Int) : Double = self.getRepeatingDouble(attr.name, index)
  
  
  /** Searchs the values of a RepeatingBooleanAttribute for a given one and returns its index, -1 for not found. */
  def findBoolean(attr : RepeatingBooleanAttribute, value : Boolean) : Int = self.findBoolean(attr.name, value)
  
  /** Searchs the values of a RepeatingIntAttribute for a given one and returns its index, -1 for not found. */
  def findInt(attr : RepeatingIntAttribute, value : Int) : Int = self.findInt(attr.name, value)
  
  /** Searchs the values of a RepeatingStringAttribute for a given one and returns its index, -1 for not found. */
  def findString(attr : RepeatingStringAttribute, value : String) : Int = self.findString(attr.name, value)
  
  /** Searchs the values of a RepeatingIdAttribute for a given one and returns its index, -1 for not found. */
  def findId(attr : RepeatingIdAttribute, value : IDfId) : Int = self.findId(attr.name, value)
  
  /** Searchs the values of a RepeatingTimeAttribute for a given one and returns its index, -1 for not found. */
  def findTime(attr : RepeatingTimeAttribute, value : IDfTime) : Int = self.findTime(attr.name, value)
  
  /** Searchs the values of a RepeatingDoubleAttribute for a given one and returns its index, -1 for not found. */
  def findDouble(attr : RepeatingDoubleAttribute, value : Double) : Int = self.findDouble(attr.name, value)
  
  
  /** Sets the value of a SingleBooleanAttribute. */
  def setBoolean(attr : SingleBooleanAttribute, value : Boolean) : Unit =
    self.setBoolean(attr.name, value)
  
  /** Sets the value of a SingleIntAttribute. */
  def setInt(attr : SingleIntAttribute, value : Int) : Unit =
    self.setInt(attr.name, value)
  
  /** Sets the value of a SingleStringAttribute. */
  def setString(attr : SingleStringAttribute, value : String) : Unit =
    self.setString(attr.name, value)
  
  /** Sets the value of a SingleIdAttribute. */
  def setId(attr : SingleIdAttribute, value : IDfId) : Unit =
    self.setId(attr.name, value)
  
  /** Sets the value of a SingleTimeAttribute. */
  def setTime(attr : SingleTimeAttribute, value : IDfTime) : Unit =
    self.setTime(attr.name, value)
  
  /** Sets the value of a SingleDoubleAttribute. */
  def setDouble(attr : SingleDoubleAttribute, value : Double) : Unit =
    self.setDouble(attr.name, value)
  
  
  /** Sets the value of a RepeatingBooleanAttribute at a given index. */
  def setRepeatingBoolean(attr : RepeatingBooleanAttribute, index : Int, value : Boolean) : Unit =
    self.setRepeatingBoolean(attr.name, index, value)
  
  /** Sets the value of a RepeatingIntAttribute at a given index. */
  def setRepeatingInt(attr : RepeatingIntAttribute, index : Int, value : Int) : Unit =
    self.setRepeatingInt(attr.name, index, value)
  
  /** Sets the value of a RepeatingStringAttribute at a given index. */
  def setRepeatingString(attr : RepeatingStringAttribute, index : Int, value : String) : Unit =
    self.setRepeatingString(attr.name, index, value)
  
  /** Sets the value of a RepeatingIdAttribute at a given index. */
  def setRepeatingId(attr : RepeatingIdAttribute, index : Int, value : IDfId) : Unit =
    self.setRepeatingId(attr.name, index, value)
  
  /** Sets the value of a RepeatingTimeAttribute at a given index. */
  def setRepeatingTime(attr : RepeatingTimeAttribute, index : Int, value : IDfTime) : Unit =
    self.setRepeatingTime(attr.name, index, value)
  
  /** Sets the value of a RepeatingDoubleAttribute at a given index. */
  def setRepeatingDouble(attr : RepeatingDoubleAttribute, index : Int, value : Double) : Unit =
    self.setRepeatingDouble(attr.name, index, value)
  
  
  /** Inserts a value for a RepeatingBooleanAttribute at a given index. */
  def insertBoolean(attr : RepeatingBooleanAttribute, index : Int, value : Boolean) : Unit =
    self.insertBoolean(attr.name, index, value)
  
  /** Inserts a value for a RepeatingIntAttribute at a given index. */
  def insertInt(attr : RepeatingIntAttribute, index : Int, value : Int) : Unit =
    self.insertInt(attr.name, index, value)
  
  /** Inserts a value for a RepeatingStringAttribute at a given index. */
  def insertString(attr : RepeatingStringAttribute, index : Int, value : String) : Unit =
    self.insertString(attr.name, index, value)
  
  /** Inserts a value for a RepeatingIdAttribute at a given index. */
  def insertId(attr : RepeatingIdAttribute, index : Int, value : IDfId) : Unit =
    self.insertId(attr.name, index, value)
  
  /** Inserts a value for a RepeatingTimeAttribute at a given index. */
  def insertTime(attr : RepeatingTimeAttribute, index : Int, value : IDfTime) : Unit =
    self.insertTime(attr.name, index, value)
  
  /** Inserts a value for a RepeatingDoubleAttribute at a given index. */
  def insertDouble(attr : RepeatingDoubleAttribute, index : Int, value : Double) : Unit =
    self.insertDouble(attr.name, index, value)
  
  
  /** Appends a value for a RepeatingBooleanAttribute at end of list. */
  def appendBoolean(attr : RepeatingBooleanAttribute, value : Boolean) : Unit =
    self.appendBoolean(attr.name, value)
  
  /** Appends a value for a RepeatingIntAttribute at end of list. */
  def appendInt(attr : RepeatingIntAttribute, value : Int) : Unit =
    self.appendInt(attr.name, value)
  
  /** Appends a value for a RepeatingStringAttribute at end of list. */
  def appendString(attr : RepeatingStringAttribute, value : String) : Unit =
    self.appendString(attr.name, value)
  
  /** Appends a value for a RepeatingIdAttribute at end of list. */
  def appendId(attr : RepeatingIdAttribute, value : IDfId) : Unit =
    self.appendId(attr.name, value)
  
  /** Appends a value for a RepeatingTimeAttribute at end of list. */
  def appendTime(attr : RepeatingTimeAttribute, value : IDfTime) : Unit =
    self.appendTime(attr.name, value)
  
  /** Appends a value for a RepeatingDoubleAttribute at end of list. */
  def appendDouble(attr : RepeatingDoubleAttribute, value : Double) : Unit =
    self.appendDouble(attr.name, value)
  
  
  /** Removes value of a RepeatingAttribute at a given index. */
  def remove(attr : RepeatingAttribute[Any], index : Int) : Unit =
    self.remove(attr.name, index)
  
  /** Removes all values of a RepeatingAttribute. */
  def removeAll(attr : RepeatingAttribute[Any]) : Unit =
	self.removeAll(attr.name)
  
  /** Truncates the values of a RepeatingAttribute at a given index. */
  def truncate(attr : RepeatingAttribute[Any], index : Int) : Unit =
    self.truncate(attr.name, index)
  
}